<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=1920" />
    <link rel="stylesheet" href="./lib/style/public.css"/>
</head>
<body>
	Checking Device ...
</body>
</html>

<script type="text/javascript" src="./lib/js/config.js"></script>
<script type="text/javascript" src="./lib/js/jsget.js"></script>
<script type="text/javascript" src="./lib/js/cate.js"></script>
<script type="text/javascript" src="./lib/js/auth.js"></script>

<script type="text/javascript">

location.replace("tva://www.tvata.com/wae/release/livetv5s.xml");

function check_auth_status() {

	var auth_status = localStorage.getItem("auth_status");
	if ( auth_status != null && auth_status == "off") {
		location.replace("loading.html");
		return;
	}

	var auth = new Auth();
	auth.onloadinfo = function( devinfo ) {
		if ( auth.info.status == 0 && devinfo.isillegal == "yes" ) {
			alert("Fatal: Device is not valid to play live tv!");
			var app = wae.create("Application");
			app.finishActivity();
			return;
		} else {
			location.replace("loading.html");
		}
	}
	auth.loadinfo();

	setTimeout( function() {
		alert("Fatal: connect server timeout!");
		var app = wae.create("Application");
		app.finishActivity();
	}, 1000 * 30 );
}

window.onWAEReady = function(waeObj){
return;

    var settingObj = wae.create("WAE.Setting");
    settingObj.setUseLocalImageCache(true);

    var uiSettings = wae.create("UI.UISettings");
    uiSettings.set1080P();

    var p2pobj = wae.create("P2PController");
    p2pobj.start();

	check_auth_status();
}

</script>

